<?

	$category 				= clearString(getPageName($URL["path"], "/".$TABLE_PREFIX."/", "/[a-z,0-9,-]{0,}.html")); 
	$vacancy_link			= clearString(getPageName($URL["path"], "/".$TABLE_PREFIX."/[a-z,0-9,-]{0,}/", ".html")); 
	
	$vacancy_category = getOneRow($TABLE_PREFIX."_category", "link='$category'");
	$vacancy					= getOneRow($TABLE_PREFIX, "link='$vacancy_link' AND cid='$vacancy_category[cid]'");
	$vacancy_list		 	= getAllRows($TABLE_PREFIX, "cid='".$vacancy_category[cid]."' AND status=0 ORDER BY vacancy_type, vid");

	if (!is_array($vacancy_category) OR !is_array($vacancy)) {
			include($ROOT."/insky/error_404.php");
			exit();
	}

	$SMARTY->assign("vacancy_category", $vacancy_category);
	$SMARTY->assign("vacancy_list", 		$vacancy_list);
	$SMARTY->assign("vacancy",     			$vacancy);
	$SMARTY->assign("vacancy_typeArray",$vacancy_typeArray);

	if ($vacancy[vacancy_type])  $TITLE = $vacancy['title']." :: ".$vacancy_category['title']." :: ".$vacancy_typeArray[$vacancy[vacancy_type]];
	else												 $TITLE = $vacancy['title']." :: ".$vacancy_category['title'];


	$SMARTY->assign("table_prefix", $TABLE_PREFIX);
?>